import { http } from "@/utils/http";
import { pageData } from "@/Model/pageDataBase";
import { resultBase, resultNotDataBase } from "@/Model/resultBase";
import { matchVM } from "@/Model/match";

/**
 * 获取分页数据
 */
export const getPageDataApi = (data?: object) => {
  return http.request<resultBase<pageData<matchVM>>>(
    "post",
    "/api/Match/GetPageList",
    {
      data
    }
  );
};
/**
 * 添加数据
 */
export const addApi = (data?: object) => {
  return http.request<resultBase<matchVM>>("post", "/api/Match/Created", {
    data
  });
};

/**
 * 禁用数据
 */
export const deleteApi = (data?: object) => {
  return http.request<resultNotDataBase>("post", "/api/Match/Disable", {
    data
  });
};
/**
 * 启用数据
 */
export const enableApi = (data?: object) => {
  return http.request<resultNotDataBase>("post", "/api/Match/Enable", {
    data
  });
};

/**
 * 修改数据
 */
export const updataApi = (data?: object) => {
  return http.request<resultBase<matchVM>>("post", "/api/Match/Update", {
    data
  });
};
